<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义指令</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>值:{{n}}</h3>
        放大10倍的值:<h3 v-big="n"></h3>
        <button @click="add">+1</button>
    </div>
    <script>
        const vm = new Vue({
            el:'#app',
            data:{
                n:1
            },
            methods: {
                add(){
                    this.n++
                }
            },
            directives:{
                // 简写属性，也叫函数式写法
                big(el,binging){
                    console.log(el)
                    console.log(binging)
                    el.innerText = binging.value*10;
                }
            }
        })
    </script>
</body>
</html>